home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 20
/
020.d81
/
math facts
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
213 lines
50 gosub60000:printchr$(142)
100 print"[147]":poke53280,0:poke53281,14
101 print"[144] type your first name"
102 input" then press <return> ";n$
103 print"[147][144]":printtab(9)"";n$;", do you want to"
104 print" add, subtract, multiply, or divide.":pn=0:nr=0:nw=0:gr=0:a=(-ti)
105 print"[144] [146]"
106 print" [150] [146]
107 [153]" def stop a press for addition def wait"
108 a$[178]" def wait":[153]a$
109 [153]" def stop s press for subtraction def wait"
110 [153]a$
111 [153]" def stop m press for multiplication def wait"
112 [153]a$
113 [153]" def stop d press for division def wait":[153]a$
114 [153]" def stop q press to exit def wait"
115 [153]" def wait
116 get an$:if an$="" then 116
117 if an$="q" then goto 63000
118 if an$="a" then goto 125
119 if an$="s" then goto 126
120 if an$="m" then goto 127
121 if an$="d" then goto 128
122 goto 116
125 as$="+":gosub3000:goto197
126 as$="-":gosub3000:goto197
127 as$="x":gosub3000:goto197
128 as$="%":gosub3000:goto197
130 gosub 3400:goto197
132 gosub 3042
197 print"[147]":poke53280,0:poke53281,14
198 printtab(5)"[144]press [158] q [146] [144]to change operations"
199 print"[144] [146]";
200 printtab(50)"[144][181]";tab(60)"[144][181]";tab(70)"[144][181]"
201 printtab(1)"problem";tab(12)"number";tab(22);"number";tab(32)"your"
202 printtab(1)"number";tab(12)"right";tab(22);"wrong";tab(32)"score"
203 printtab(3)"[158]";pn;tab(13)nr;tab(24);nw;tab(32)gr
204 print"[144] [146][145][145][145][145][145][145]";
206 fory=1to5:printtab(10)"[144][181]";tab(20)"[144][181]";tab(30)"[144][181]":next y
212 printtab(10)" [146]":pn=pn+1
213 printtab(10)" [150] [146]"
214 printtab(10)" [150] [146]"
215 printtab(10)" [150] [146]"
220 printtab(10)" [146]"
225 if an$="a" or an$="m" then goto231
230 printtab(15)"[145][145][145][144]";a2;"[157] ";as$;b1;"[157] ":goto235
231 printtab(15)"[145][145][145][144]";b1;"[157] ";as$;a2;"[157] "
235 input" ";c$:c2=val(c$)
237 if c$="q" then goto 103
240 if c2=d then gosub 2200
245 if c2<>d then gosub 2100
247 gr=int((nr/(nr+nw))*100)
250 if y$="q" then goto 130
255 goto 132
2099 goto2199: rem go to the end of program
2100 print"[147]":poke53281,0:poke53280,0
2130 printtab(4)"[145][169] [223][146]"
2131 printtab(3)"[169] [223][146]"
2132 printtab(2)"[169] [146][169] [223] [223][146]"
2133 printtab(2)" [146][169] [223] [146]"
2134 printtab(2)" [146][169] [162][162][162][162] [162][162][162][162] [223] [146]"
2136 printtab(2)"[169] [175][175][175][175] [175][175][175][175] [223]"
2138 printtab(2)"[180] [180][149][213][201][170] [180] [170] [180][149][213][201][170] [170]"
2140 printtab(0)"[213][192][180] [180][149][202][203][170] [180] [170] [180][149][202][203][170] [170][192][201]"
2142 printtab(0)"[221] [180] [183][183][183][183] [180] [170] [183][183][183][183] [170] [221]"
2144 printtab(0)"[221] [180] [205] [180] [170] [206] [170] [221]"
2146 printtab(0)"[221] [180] [170] [206] [205] [180] [170] [221]"
2148 printtab(0)"[202][192][180] [170] [180] [170] [180] [170][192][203]"
2150 printtab(2)"[205] [163][163][163][163][163] [206]"
2152 printtab(3)"[205] [206] ";n$
2154 printtab(4)"[205] [150][206][184][184][184][205] [206] i am sorry"
2156 printtab(5)"[205] [150][184][184][184][184][184] [206] but "
2158 printtab(6)"[202][192][192] [192][192][203] "
2159 if an$="a" or an$="m" then goto 2161
2160 printtab(6)" [205][175][175][175][175][175][206] ";a2;as$;b1;"is not ";c$;"":goto 2162
2161 printtab(6)" [205][175][175][175][175][175][206] ";b1;as$;a2;"is not ";c$;""
2162 nw=nw+1
2165 gosub 4000
2190 gosub 9000
2191 n2=n2+1:if n2>16 then n2=0
2192 return
2199 load"hello connect",8
2200 print"[147]":poke53280,n1:poke53281,0
2210 x=int(6*rnd(0)+1)
2211 if x = 1 then goto 2221
2212 if x = 2 then goto 2222
2213 if x = 3 then goto 2223
2214 if x = 4 then goto 2224
2215 if x = 5 then goto 2225
2216 if x = 6 then goto 2226
2221 printtab(14)"great, ";n$:goto2230
2222 printtab(12)"good work, ";n$:goto2230
2223 printtab(13)"correct, ";n$:goto2230
2224 printtab(10)n$;", you are smart":goto2230
2225 printtab(4)n$;", you're ready to graduate.":goto2230
2226 printtab(10)n$;", you're good":goto2230
2230 printtab(12)"[158][169] [223][146]"
2231 printtab(11)"[158][169] [223][146]"
2232 printtab(10)"[158][169] [146][169] [223] [223][146]"
2233 printtab(9)"[158][169] [146][169] [223] [223][146]"
2234 printtab(9)"[158] [146][169] [162][162][162][162] [162][162][162][162] [223] [146]"
2236 printtab(9)"[158] [146][169] [175][175][175][175] [175][175][175][175] [158][223] [146]"
2238 printtab(9)"[158] [146] [180][154][213][201][170] [180] [170] [180][154][213][201][170] [158] [146]"
2240 printtab(8)"[213][192][180] [180][154][202][203][170] [180] [170] [180][154][202][203][170] [170][192][201]"
2242 printtab(8)"[221] [180] [183][183][183][183] [180] [170] [183][183][183][183] [170] [221]"
2244 printtab(8)"[221] [180] [205] [180] [170] [206] [170] [221]"
2246 printtab(8)"[221] [180] [170] [206] [205] [180] [170] [221]"
2248 printtab(8)"[202][192][180] [170] [180] [170] [180] [170][192][203]"
2250 printtab(10)"[205] [206] [184][184][184][184][184] [205] [206]"
2252 printtab(11)"[205] [150][185][185][185][185][185][185][185] [206]"
2254 printtab(12)"[205] [150][205] [206] [206]"
2256 printtab(13)"[205] [150][183][183][183][183][183] [206]"
2258 printtab(14)"[202][192][192] [192][192][203]
2260 [153][163]14)" (NULL)andandandandand(NULL)":nr[178]nr[170]1
2290 [129]y[178]1[164]1000:[130]y
2291 n1[178]n1[170]1:[139] n1[177]15 [167] n1[178]0:
2292 [142]
3000 [153]"load":[151]53280,0:[151]53281,0
3001 [139] an$[178]"a" [167] nb$[178]"addition of"
3002 [139] an$[178]"s" [167] nb$[178]"subtraction of"
3003 [139] an$[178]"m" [167] nb$[178]"multiply by"
3004 [139] an$[178]"d" [167] nb$[178]"division by"
3010 [153]"load please choose which work you want"
3015 [139] an$[178]"d" [167] [137] 3020
3016 [153]" sys w waitopen all digits -- zero through nine"
3017 [153][163]7)" def 0 wait ";nb$;" zero":[137] 3025
3020 [153]" sys w waitopen all digits -- one through nine"
3025 [153][163]7)" def 1 wait ";nb$;" one"
3026 [153][163]7)" def 2 wait ";nb$;" two"
3027 [153][163]7)" def 3 wait ";nb$;" three"
3028 [153][163]7)" def 4 wait ";nb$;" four"
3029 [153][163]7)" def 5 wait ";nb$;" five"
3030 [153][163]7)" def 6 wait ";nb$;" six"
3031 [153][163]7)" def 7 wait ";nb$;" seven"
3032 [153][163]7)" def 8 wait ";nb$;" eight"
3033 [153][163]7)" def 9 wait ";nb$;" nine"
3040 [161] h$:[139] h$[178]"" [167] 3040
3042 [139] h$[178]"w" [167] [137] 3400
3044 h[178][197](h$)
3045 [139] h$[179]"0" [176] h$[177]"9" [167] 3040
3048 a1[178][181](10[172][187](0)):b1[178]h:
3050 [139] an$[178]"a" [167] a2[178]a1
3052 [139] an$[178]"s" [167] a2[178]a1[170]h:
3054 [139] an$[178]"m" [167] a2[178]a1
3056 [139] an$[178]"d" [167] a2[178]a1[172]h
3058 [139] an$[178]"a" [167] d[178]a2[170]h
3060 [139] an$[178]"s" [167] d[178]a1
3062 [139] an$[178]"m" [167] d[178]a2[172]h
3064 [139] an$[178]"d" [167] d[178]a1
3066 [142]
3400 a1[178][181](10[172][187](0))
3401 [139] an$[178]"d" [167] [137] 3403
3402 b1[178][181](10[172][187](0)):[137] 3405
3403 b1[178][181](9[172][187](0)[170]1)
3405 [139] an$[178]"a" [167] a2[178]a1
3406 [139] an$[178]"m" [167] a2[178]a1
3407 [139] an$[178]"s" [167] a2[178](a1[170]b1)
3408 [139] an$[178]"d" [167] a2[178](a1[172]b1)
3409 [139] an$[178]"a" [167] d[178]a2[170]b1
3410 [139] an$[178]"m" [167] d[